import Vue from 'vue';
import { post } from '@/api/service';
import api from './api';

declare module 'vue/types/vue' {
  interface Vue {
    $api: typeof api;
    $post: typeof post;
  }
}

export { post, api };

export default {
  install() {
    Object.defineProperties(Vue.prototype, {
      $post: {
        value: post,
      },
      $api: {
        value: api,
      },
    });
  },
};
